/*
 * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <tencentcloud/tbaas/v20180416/model/SrvInvokeRequest.h>
#include <tencentcloud/core/utils/rapidjson/document.h>
#include <tencentcloud/core/utils/rapidjson/writer.h>
#include <tencentcloud/core/utils/rapidjson/stringbuffer.h>

using namespace TencentCloud::Tbaas::V20180416::Model;
using namespace rapidjson;
using namespace std;

SrvInvokeRequest::SrvInvokeRequest() :
    m_serviceHasBeenSet(false),
    m_methodHasBeenSet(false),
    m_paramHasBeenSet(false)
{
}

string SrvInvokeRequest::ToJsonString() const
{
    Document d;
    d.SetObject();
    Document::AllocatorType& allocator = d.GetAllocator();


    if (m_serviceHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "Service";
        iKey.SetString(key.c_str(), allocator);
        d.AddMember(iKey, Value(m_service.c_str(), allocator).Move(), allocator);
    }

    if (m_methodHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "Method";
        iKey.SetString(key.c_str(), allocator);
        d.AddMember(iKey, Value(m_method.c_str(), allocator).Move(), allocator);
    }

    if (m_paramHasBeenSet)
    {
        Value iKey(kStringType);
        string key = "Param";
        iKey.SetString(key.c_str(), allocator);
        d.AddMember(iKey, Value(m_param.c_str(), allocator).Move(), allocator);
    }


    StringBuffer buffer;
    Writer<StringBuffer> writer(buffer);
    d.Accept(writer);
    return buffer.GetString();
}


string SrvInvokeRequest::GetService() const
{
    return m_service;
}

void SrvInvokeRequest::SetService(const string& _service)
{
    m_service = _service;
    m_serviceHasBeenSet = true;
}

bool SrvInvokeRequest::ServiceHasBeenSet() const
{
    return m_serviceHasBeenSet;
}

string SrvInvokeRequest::GetMethod() const
{
    return m_method;
}

void SrvInvokeRequest::SetMethod(const string& _method)
{
    m_method = _method;
    m_methodHasBeenSet = true;
}

bool SrvInvokeRequest::MethodHasBeenSet() const
{
    return m_methodHasBeenSet;
}

string SrvInvokeRequest::GetParam() const
{
    return m_param;
}

void SrvInvokeRequest::SetParam(const string& _param)
{
    m_param = _param;
    m_paramHasBeenSet = true;
}

bool SrvInvokeRequest::ParamHasBeenSet() const
{
    return m_paramHasBeenSet;
}


